import { Upload, message, Button, Icon } from 'antd';

export default () => {
    const props = {
        name: 'file',
        action: '//jsonplaceholder.typicode.com/posts/',
        onChange(info) {
          if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
          }
          if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
          } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
          }
        },
      };

      return (
          <div>
              <Upload {...props}>
                  <Button>
                      <Icon type="upload" /> Click to Upload
                  </Button>
              </Upload>
              <p>================</p>
              <a href="http://img2.chinadaily.com.cn/images/202003/01/5e5b0910a310128206577ffb.jpeg" download="filename.zip">Download file</a>
          </div>
      );
}